<!DOCTYPE html>
<html lang="zh" th:codetype="utf-8" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>鲜花搜索</title>
    <link rel="stylesheet" type="text/css" href="css/toolbar/normalize.css" th:href="@{/css/toolbar/normalize.css}"/>
    <link rel="stylesheet" type="text/css" href="css/toolbar/htmleaf-demo.css" th:href="@{/css/toolbar/htmleaf-demo.css}"/>
    <link rel="stylesheet" type="text/css" href="css/toolbar/style.css" th:href="@{/css/toolbar/style.css}"/>
    <link rel="stylesheet" type="text/css" href="css/tour/normalize.css" th:href="@{/css/tour/normalize.css}"/>
    <link rel="stylesheet" type="text/css" href="css/tour/demo.css" th:href="@{/css/tour/demo.css}"/>
    <link rel="stylesheet" type="text/css" href="fonts/tour/font-awesome-4.2.0/css/font-awesome.min.css" th:href="@{/fonts/tour/font-awesome-4.2.0/css/font-awesome.min.css}"/>
    <link rel="stylesheet" type="text/css" href="css/tour/menu_sideslide.css" th:href="@{/css/tour/menu_sideslide.css}"/>
    <link rel="stylesheet" type="text/css" href="css/img.css" th:href="@{/css/img.css}"/>
</head>
<body>
<div class="container">
    <div class="menu-wrap">
        <nav class="menu">
            <!--侧滑栏-->
            <div class="icon-list">
                <a href="/userInfo" th:href="@{/userInfo}">
                    <span>
                        <div id="divcss5"><!--用户头像-->
                            <img src="/get/userImg/${session.loginUser.userName}"  th:src="@{'/get/userImg/'+${session.loginUser.userName}}" alt="头像" height="80" width="80"/>
                        </div>
                        <!--用户名-->
                        [[${session.loginUser.userName}]]
                    </span></a>
                <th:block th:if="${session.loginUser.role==true}">
                    <a href="/shop/shopIndex" th:href="@{/shop/shopIndex}"><i class="fa fa-fw fa-bar-chart-o"></i><span>主页</span></a>
                    <a href="/shop/addGoodPage" th:href="@{/shop/addGoodPage}"><i class="fa fa-fw fa-star-o"></i><span>添加鲜花</span></a>
                    <a href="/shop/getShopOrder/unsent" th:href="@{/shop/getShopOrder/unsent}"><i class="fa fa-fw fa-bell-o"></i><span>订单</span></a>
                </th:block>
                <th:block th:if="${session.loginUser.role==false}">
                    <a href="/shopping/shoppingIndex" th:href="@{/shopping/shoppingIndex}"><i class="fa fa-fw fa-bar-chart-o"></i><span>主页</span></a>
                    <a href="/shopping/shoppingCart/${session.loginUser.userName}/false" th:href="@{'/shopping/shoppingCart/'+${session.loginUser.userName}+'/false'}"><i class="fa fa-fw fa-star-o"></i><span>购物车</span></a>
                    <a href="/shopping/getUserOrder/unSent" th:href="@{/shopping/getUserOrder/unSent}"><i class="fa fa-fw fa-bell-o"></i><span>订单</span></a>
                </th:block>
                <a href="/update/updateUserInfo" th:href="@{/update/updateUserInfo}"><i class="fa fa-fw fa-envelope-o"></i><span>修改个人信息</span></a>
                <a href="/logOut" th:href="@{/logOut}"><i class="fa fa-fw fa-newspaper-o"></i><span>退出登录</span></a>
            </div>
        </nav>
        <button class="close-button" id="close-button">Close Menu</button>
    </div>
    <button class="menu-button" id="open-button">Open Menu</button>
    <div class="content-wrap">
        <div class="content">
            <div class="htmleaf-container">
                <header class="htmleaf-header">
                    <h1>在线鲜花 <span>足不出户就能送货上门</span></h1>
                </header>
                <!--搜索框-->
                <span>
                    <form method="post" action="/search/search" th:attr="action=@{/search/search}" name="searchItem">
                    <select id="searchSelect" name="searchSelect">
                        <option th:selected="${searchItem.searchSelect=='搜索商家'}" value="搜索商家">搜索商家</option>
                        <option th:selected="${searchItem.searchSelect=='搜索鲜花'}" value="搜索鲜花">搜索鲜花</option>
                    </select>
                    <select id="species" name="species">
                        <option th:selected="${searchItem.species=='鲜花类型'}" value="鲜花类型">鲜花类型</option>
                        <option th:selected="${searchItem.species=='切花'}" value="切花">切花</option>
                        <option th:selected="${searchItem.species=='盆栽'}" value="盆栽">盆栽</option>
                    </select>
                    <input name="searchContent" th:value="${searchItem.searchContent}" type="text"/>
                    <input name="currentPage" value="1" type="hidden"/>
                    <input name="pageSize" value="5" type="hidden"/>
                    <input type="submit" value="搜索">
                </form>
                    <br/><br/><br/>
                </span>
                <div id="centralTable">
                    <table border="1" cellpadding="5" cellspacing="0">
                        <tr>
                            <td>购物车</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
                            <td>
                                <form method="post" action="/shopping/cleanShoppingCart/${shoppingCart.orderId}"
                                th:attr="action=@{'/shopping/cleanShoppingCart/'+${shoppingCart.orderId}}">
                                    <input type="submit" value="清空购物车"/>
                                </form>
                            </td>
                        </tr>
                        <tr>
                            <th>商家</th>
                            <th>鲜花状态</th>
                            <th>GID</th>
                            <th>鲜花名称</th>
                            <th>销量</th>
                            <th>库存数量</th>
                            <th>售价</th>
                            <th>鲜花类型</th>
                            <th>鲜花图片</th>
                            <th>备注</th>
                            <th>价格</th>
                            <th>购买数量</th>
                            <th>查看详情</th>
                            <th>删除</th>
                        </tr>
                        <span th:each="orderItemInfo:${orderItemInfos}">
                            <tr>
                                <td><a href="/shop/goShopping/${orderItemInfo.shopName}" th:href="@{'/shop/goShopping/'+${orderItemInfo.shopName}}">进入店铺</a></td>
                                <td th:if="${orderItemInfo.good.status==true}" th:text="在售">在售</td>
                                <td th:if="${orderItemInfo.good.status==false}" th:text="已下架">已下架</td>
                                <td th:text="${orderItemInfo.good.goodId}"></td>
                                <td th:text="${orderItemInfo.good.goodName}"></td>
                                <td th:text="${orderItemInfo.good.sellNum}"></td>
                                <td th:text="${orderItemInfo.good.quantity}"></td>
                                <td th:text="${orderItemInfo.good.sellPrice}"></td>
                                <td th:text="${orderItemInfo.good.species}"></td>
                                <td><img src="/get/goodImg/${orderItemInfo.good.goodId}" th:src="@{'/get/goodImg/'+${orderItemInfo.good.goodId}}" width="100" height="100" alt="鲜花图片"/></td>
                                <td>
                                    <form method="post" action="/update/updateNote" th:attr="action=@{/update/updateNote}">
                                        <textarea name="note" id="note" th:utext="${orderItemInfo.note}"></textarea>
                                        <input type="hidden" name="orderId" th:value="${shoppingCart.orderId}"/>
                                        <input type="hidden" name="goodId" th:value="${orderItemInfo.good.goodId}"/>
                                        <input type="submit" value="更改"/>
                                    </form>
                                </td>
                                <td th:text="${orderItemInfo.goodNum*orderItemInfo.good.sellPrice}"></td>
                                <td>
                                    <form action="/update/updateGoodNum" th:attr="action=@{/update/updateGoodNum}" method="post">
                                        <input type="hidden" name="orderId" th:value="${shoppingCart.orderId}"/>
                                        <input type="hidden" name="goodId" th:value="${orderItemInfo.good.goodId}"/>
                                        <input type="text" name="goodNum" th:value="${orderItemInfo.goodNum}"/>
                                        <input type="submit" value="更改"/>
                                    </form>
                                </td>
                                <td>
                                    <form action="/get/goodInfo/${orderItemInfo.good.goodId}" th:attr="action=@{'/get/goodInfo/'+${orderItemInfo.good.goodId}}" name="searchItem" method="post">
                                        <input name="searchSelect" value="搜索商家" type="hidden"/>
                                        <input name="species" value="鲜花类型" type="hidden"/>
                                        <input name="searchContent" value="" type="hidden"/>
                                        <input type="submit" value="查看详情">
                                    </form>
                                </td>
                                <td>
                                    <form method="post" action="/shopping/delOrderItem" th:attr="action=@{/shopping/delOrderItem}">
                                        <input name="orderId" type="hidden" th:value="${shoppingCart.orderId}">
                                        <input name="goodId" type="hidden" th:value="${orderItemInfo.good.goodId}">
                                        <input type="submit" value="删除">
                                    </form>
                                </td>
                            </tr>
                        </span>
                        <tr>
                            <th th:text="'总价：'+${shoppingCart.count}"></th>
                            <th>
                                <form action="/shopping/settlement" th:attr="action=@{/shopping/settlement}" method="post">
                                    <input name="userId" type="hidden" th:value="${shoppingCart.userId}">
                                    <input name="orderId" type="hidden" th:value="${shoppingCart.orderId}">
                                    <input type="text" name="address" th:value="${session.loginUser.address}">[[${addressMsg}]]<br/>
                                    <input type="submit" value="立即购买">
                                </form>
                            </th>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div><!-- /content-wrap -->
</div><!-- /container -->
<script src="js/tour/classie.js" th:src="@{/js/tour/classie.js}"></script>
<script src="js/tour/main.js" th:src="@{/js/tour/main.js}"></script>
</body>
</html>